import time

def P(a):
    def A(*b, **c):
        d = time.time()
        e = a(*b, **c)
        f = time.time()
        print(f"函数 {a.__name__} 执行时间: {f - d} 秒")
        return e
    return A

@P
def B():
    time.sleep(2)
    print("函数执行完成")

B()